<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>Vue循环结构</h2>
        <div id="app">
           <div v-for="(v,k,i) in obj">{{v+'---'+k+'---'+i}}</div> <br>

           <!-- v-if只有符合条件的才会被渲染 -->
           <div v-if='v===13' v-for="(v,k,i) in obj">{{v+'---'+k+'---'+i}}</div> 
        </div>
</body>
<script src="./js/vue.js"></script>
<script>
//使用原生js遍历对象    注意：for..in..不推荐遍历数组
var obj = {
    uname: 'lisi',
    age:  12,
    gender: 'male'
}
for(var key in obj){
    console.log(key,obj[key])
}
    var vm = new Vue({
        el: '#app',
        data: {
            obj : {
                uname: 'zlisi',
                age:  13,
                gender: 'male'
            }
        }
    })
    /*
        总结：
            v-for遍历对象          
                     <div v-for='(value,key,index) in object'></div>

            v-if和v-for结合使用
                    <div v-if='value===12' v-for='(value,key,index) in object'></div>
    */
</script>
</html>